package com.cybertron.ironhide.manage.common.jstl;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.cybertron.ironhide.manage.common.base.Pager;

public class Pagination extends TagSupport {

	/**
	 * 
	 */
	private Pager pageBean;
	private String pageUrl;
	private String pageRel;
	private String targetType;
	private static final long serialVersionUID = 904629052632727931L;

	@Override
	public int doStartTag() throws JspException {
		super.doStartTag();
		pageContext.setAttribute("pager", pageBean);
		pageContext.setAttribute("pageUrl", pageUrl);
		pageContext.setAttribute("pageRel", pageRel);
		pageContext.setAttribute("targetType", targetType);
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		super.doEndTag();
		return EVAL_PAGE;
	}

	public void setPageBean(Pager pageBean) {
		this.pageBean = pageBean;
	}

	public void setPageUrl(String pageUrl) {
		this.pageUrl = pageUrl;
	}

	public void setPageRel(String pageRel) {
		this.pageRel = pageRel;
	}

	public void setTargetType(String targetType) {
		this.targetType = targetType;
	}

}
